<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<div class="modal-dialog ms-modal-dialog" style="width: 580px; margin-top: 100px;">
  <div class="modal-content">
     
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">编辑</h4>
    </div>

    <form class="form-horizontal ms-form" role="form" method="POST" action="${ctx.host}/reforms/${reform.id}" data-validate="true">

      <input type="hidden" name="_method" value="PATCH" />
      <input type="hidden" name="id" value="${reform.id}" />

      <div class="modal-body">
      
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">约谈时间：</label>
          <div class="col-xs-7">
            <input type="text" name="appointTime" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${reform.appointTime}" />" data-validate="required" class="form-control date" placeholder="约谈时间" autocomplete="off"/>
          </div>
        </div>
       
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">整改到期时间：</label>
          <div class="col-xs-7">
            <input type="text" name="endTime" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${reform.endTime}" />" data-validate="required" class="form-control date" placeholder="整改到期时间" autocomplete="off"/>
          </div>
        </div>
        
       <div class="form-group ms-form-group">
          <label class="col-xs-3 control-label">出席人员：</label>
          <div class="col-xs-8" style="width: 300px;">
            <textarea name="attendee" rows="1" cols="40" data-validate="required">${reform.attendee}</textarea>
          </div>
        </div>
      
        <div class="form-group ms-form-group">
          <label class="col-xs-3 control-label">约谈内容：</label>
          <div class="col-xs-8" style="width: 300px;">
            <textarea name="theme" rows="2" cols="40" data-validate="required">${reform.theme}</textarea>
          </div>
        </div>
      
        <div class="form-group ms-form-group">
          <label class="col-xs-3 control-label">约谈详情：</label>
          <div class="col-xs-8" style="width: 300px;">
            <textarea name="description" rows="4" cols="40" data-validate="required">${reform.description}</textarea>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-3 control-label">整改结果：</label>
          <div class="col-xs-7">
           <select name=reformStatus data-validate="required" class="select2 form-control" tabindex="8" >
              <option></option>
              <c:forEach items="${enums['ReformStatus']}" var="reformStatus">
                <option value="${reformStatus}" ${reformStatus ==  reform.reformStatus ? 'selected' : ''}>${reformStatus.description}</option>
              </c:forEach>
            </select>
          </div>
        </div>
        
        
      </div>
      
      <div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn ms-btn btn-primary">确定</button>
        <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
      </div>

    </form>
    
  </div>
</div>

<script type="text/javascript">
  $(document).ready(function () {
    
    $('select').select2({
      theme: "classic",
      placeholder: '请选择',
      minimumResultsForSearch: 10,
      allowClear: true,
    });
    
    $('.date').datetimepicker({
      format: 'yyyy-mm-dd',
      autoclose: true,
      language: 'zh-CN',
      todayBtn: 'linked',
      startDate: '${today}',
      todayHighlight: true,
      pickerPosition: 'bottom-right',
      minView: 'month'
    });

  })
</script>